package com.zl.service.impl;

import com.zl.dao.OrderDetailDao;
import com.zl.pojo.OrderDetail;
import com.zl.service.OrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class OrderDetailServiceImpl implements OrderDetailService {
    @Autowired
    private OrderDetailDao Odd;
    @Override
    public List<OrderDetail> queryById(Integer id) {
        List<OrderDetail> odl=Odd.queryById(id);
        return odl;
    }

    @Override
    public int updateODD(OrderDetail oda) {
        int result=0;
        result=Odd.updateODD(oda);
        return result;
    }

    @Override
    public OrderDetail query(Integer orderId, Integer productId) {
        OrderDetail oda=Odd.query(orderId,productId);

        return oda;
    }

    @Override
    public Double queryOrderCostByOrderId(Integer orderId) {
       Double cost= Odd.queryOrderCostByOrderId(orderId);
        return cost;
    }

    @Override
    public int delete(OrderDetail odd) {
        int result=Odd.delete(odd);
        return result;
    }

}
